
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author ZhangZhongGen
 */
@Data
@NoArgsConstructor
public class YearMonth {
    private Integer year;
    private Integer month;

    public YearMonth(Integer year, Integer month) {
        if (year == null || year < 0) {
            throw new IllegalArgumentException("Year must be a non-negative integer.");
        }
        if (month == null || month < 1 || month > 12) {
            throw new IllegalArgumentException("Month must be between 1 and 12.");
        }
        this.year = year;
        this.month = month;
    }
}
